<?php
// +----------------------------------------------------------------------
// | User: zq
// +----------------------------------------------------------------------
// | Time: 2021/12/7 11:50
// +----------------------------------------------------------------------

namespace App\Services\Goods;

use App\Models\Goods\Brand;
use App\Services\BaseService;

class BrandService extends BaseService
{
    public function getBrand(int $id)
    {
        return Brand::query()->find($id);
    }

    public function getBrandList(int $page, int $limit, $sort, $order, $columns = ['*'])
    {
        $query = Brand::query();
        if (!empty($sort) && !empty($order)) {
            $query = $query->orderBy($sort, $order);
        }
        return $query->paginate($limit, $columns, 'page', $page);
    }
}